home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lantools
/
blueprnt
/
child.mod
< prev
next >
Wrap
Text File
|
1989-09-27
|
3KB
|
83 lines
;************************************************************
;* Child Process Creation Module (CHILD.MOD) *
;* by Craig Chaiken *
;* September 20, 1989 *
;* *
;* Function: Executes DOS Command Line as Child Process. *
;************************************************************
;
;*** Variables ***
;
pblock:
envstr dw ?
comlin dw ?,?
fcb1 dw ?,?
fcb2 dw ?,?
fname db '\command.com',0
command db 3,'/c '
db 128 dup (?)
drvmod db 26 dup (-1)
comman proc near
cmp packet_buffer,'E'
jz comma1
ret
comma1: mov cx,packet_length
dec cx
add byte ptr command,cl
lea si,packet_buffer+1
lea di,command+3
call sitodi
jmp child
comman endp
child proc near ;*** Executes Child Process ***
call drive_unknown_state
mov ax,4a00h ;determine free memory
mov bx,07ffh
int 21h
mov ax,cs ;initialize child's environment
mov [comlin+2],ax ;command tail segment
mov [fcb1+2],ax ;file control block 1 segment
mov [fcb2+2],ax ;file control block 2 segment
mov ax,[2ch] ;segment of environment block
mov word ptr [envstr],0
lea ax,command ;offset of command tail
mov [comlin],ax
mov ax,5ch ;offset of fcb 1
mov [fcb1],ax
mov al,6ch ;offset of fcb 2
mov [fcb2],ax
mov ax,4b00h ;load and execute command
lea bx,pblock
lea dx,fname
int 21h
mov ax,4900h ;release memory
int 21h
cli
mov ss,cs:sslocal
mov sp,cs:splocal
sti
push cs
pop ds
ret
child endp
drive_unknown_state proc near ;flag all drives as modified
lea si,drive_table
mov bx,maxsockets
mov cl,5
shl bx,cl
mov al,-1
rep stosb
ret
drive_unknown_state endp
;************************************************************
;* End of Child Process Creation Module *
;************************************************************